<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="csrf-param" content="csrf-token" />
<meta name="csrf-token" th:content="${csrf}" />
<meta name="message" th:content="${message}" />
<title>系统域名访问受限</title>
<style>
body {
	font: 16px arial, 'Microsoft Yahei', 'Hiragino Sans GB', sans-serif;
}

h1 {
	margin: 0;
	color: #3a87ad;
	font-size: 26px;
}

.content {
	width: 45%;
	margin: 0 auto;
}

.content>div {
	margin-top: 200px;
	padding: 20px;
	background: #d9edf7;
	border-radius: 12px;
}

.content dl {
	color: #2d6a88;
	line-height: 40px;
}

.content div div {
	padding-bottom: 20px;
	text-align: center;
}

.content input {
	width: 280px;
	height: 20px;
	line-height: 20px;
}

.content button {
	width: 52px;
	height: 26px;
	text-align: center;
	cursor: pointer;
}
</style>
</head>
<body>
	<div class="content">
		<div>
			<h1>无法访问</h1>
			<dl>
				<dt>您访问的网页受限，根据《网络安全法》规定，系统默认域名（<span th:text="${#httpServletRequest.serverName}"></span>）禁止对外公开访问，你可通过以下两种方式解除限制：</dt>
				<dd>1：将系统域名设置301重定向至您的域名；</dd>
				<dd>2：输入访问密码进行访问（后台->整站管理->域名设置->访问密码）；</dd>
			</dl>
			<div style="justify-content: center; align-items: center; display: flex;">
				<input type="text" name="password" />
				&nbsp;&nbsp;
				<button>访问</button>
			</div>
		</div>
	</div>
	<input type="hidden" name="post-url" th:value="${postUrl}" />
	<input type="hidden" name="request-url" th:value="${uri}" />
	<script type="text/javascript" charset="utf-8" th:src="${jQuery}"></script>
	<script type="text/javascript">
		$(function(){
			$('.content button').on('click', function(){
				var param = {
					csrf:$('meta[name="'+$('meta[name="csrf-param"]').attr("content")+'"]').attr("content"),
					token:$('.content input').val()
				};
				
				$.post($('input[name="post-url"]').val(), param, function(data){
					if(data && data.message && data.message.message){
						alert(data.message.message);
						return;
					}
					if(data && data.data && parseInt(data.data) == 1){
						window.location.href=$('input[name="request-url"]').val();
					}
				});
			});
			
			$("body").keydown(function(){
				if(event.keyCode == "13"){
					$('.content button').click();
				}
			});
		});
	</script>
</body>
</html>

